package classloader;

public class ClassLoaderClassDemo1 {
    public static void main(String[] args) {
        //获取应用程序类加载器/系统类加载器                sun.misc.Launcher$AppClassLoader@18b4aac2
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();

        //获取应用程序类加载器的父加载器 --- 扩展类加载器    sun.misc.Launcher$ExtClassLoader@6a6824be
        ClassLoader classLoader1 = systemClassLoader.getParent();

        //获取扩展类加载器的父加载器 --- 启动类加载器       null
        ClassLoader classLoader2 = classLoader1.getParent();

        System.out.println("应用程序类加载器" + systemClassLoader);
        System.out.println("扩展类加载器" + classLoader1);
        System.out.println("启动类加载器" + classLoader2);
    }
}
